// logs.js
const util = require('../../utils/util.js')

Page({
  data: {
    dl:"",
    zc:"display:none",
    error:"display:none",
    user:"zsan",
    password:"12345",
    yz:""
  },
  onLoad() {
    wx.clearStorage()
    wx.setStorage({
      key:"zsan",
      data:"12345"
    })
  },


  log(){
    var that = this

    wx.getStorage({
      key:this.data.user,
      success(data){
        that.setData({
          yz:data.data,
        })

        if(that.data.password==that.data.yz){
          console.log(that.data.password);
          console.log(that.data.yz);
          wx.switchTab({
            url: '../home/home',
          })
          wx.setStorageSync('user', that.data.user)
        }else{
          that.setData({
            error:""
          })
        }
      }      
    })

  },

  zc(){
    this.setData({
      dl:"display:none",
      zc:"",
    })
  },

  sin(){
    wx.setStorage({
      key:this.data.user,
      data:this.data.password
    }),

    this.setData({
      dl:"",
      zc:"display:none",
    })
  }
    
})
